<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>任务</title>
    <link rel="stylesheet" type="text/css" href="../css/page/task.css" />
</head>

<body>
    <div class="page backf7" @vue:mounted="mounted">
        <div class="nav-bar">
            <span class="nav-bar-title">任务</span>
        </div>
        <div class="scroll-view-y ">
            <!-- 用户信息 -->
            <div class=" coincon">
                <div class='coininfo'>
                    <div class="coininfoCol" v-if="false">
                        <p>冻结金币</p>
                        <div class="coininfoColnum">{{data.coinLock.toFixed(2)}}</div>
                    </div>
                    <div class="coininfoCol" style="margin-right: 30px; margin-left:10px ;">
                        <p>可用金币</p>
                        <div class="coininfoColnum">{{data.coinOK.toFixed(2)}}</div>
                    </div>
                    <div class="coininfoCol" style="margin-right: 30px;">
                        <p>可提余额</p>
                        <div class="coininfoColnum">{{data.coinM.toFixed(2)}}</div>
                    </div>
                    <div class="coininfoCol">
                        <div @click="usertast('getm')" class="    w100p   tac  "
                            style="color:#000000; background-color: #ffffff; height: 40px ; font-size: 20px; border-radius: 20px; line-height: 40px; margin-top: 55px;">
                            去提现</div>
                    </div>
                </div>

                <div class='coininfo2'>
                    <div class="coininfoCol2" @click="usertast('coinbill')">
                        金币流水
                    </div>
                    <div class="coininfoCol2" @click="usertast('mbill')">
                        提现流水
                    </div>

                    <div class="coininfoCol2" @click="usertast('trans')">
                        转让金币
                    </div>
                    <div class="coininfoCol2" @click="refresh()">
                        刷新余额
                    </div>
                </div>
                <div class="coinhelp">
                    <span @click="showhelp()"> 说明信息：提现等待审核后到账。 查看帮助>> </span>

                </div>
            </div>

            <div class=" coincon" style="height:110px;">
                    <div class="coininfoColTeam">
                        <div @click="usertast('myshare')" class="btn-share">我要分享1</div>
                        <div @click="usertast('myshare')" class="btn-share" >  我的团队</div>
                    </div>

                <div class='coininfo2'>
                    <div class="coininfoCol2" style="margin-top:12px" @click="usertast('myshare')">
                        成员金币
                    </div>
                    <div class="coininfoCol2" style="margin-top:12px" @click="usertast('myshare')">
                        成员活动
                    </div>
                    <div class="coininfoCol2" style="margin-top:12px" @click="usertast('myshare')">
                        分享收益
                    </div>
                    <div class="coininfoCol2" style="margin-top:12px" @click="usertast('mygift')">
                        我的提成
                    </div>
                </div>

            </div>
            <div class=" taskhitlistcon">
                <div class="tasktitle">每日打卡</div>
                <div>
                    <!--   <div  class="taskbd"  @click="gofind();">每日2元打卡，特别活动</div>
                    <div  class="taskbdtxt" @click="gofind();" >
                        1.下面第一个任务，每日百度打卡。每日可提2元。<br/>
                        2.每日每一次打开看新闻任务4倍奖励。<br/>
                        3.每停2小时再打入，奖励加倍。<br/>
                        4.新闻和视频是一样的，随便点开看，找爱看的看。<br/>
                        5.每天看过的，同一篇只能得一次奖励。<br/>
                        6.当天一定要支付宝提现。随时可提，2小时到账。<br/>
                        7.没有支付宝的，加微信beijingdaqi ，微信红包。
                    </div>-->
                    <div v-for="item of data.taskListKa" class="flexrow flexbetween  taskhitlist"
                        @click="showTask(item)">

                        <div class="w250p ">
                            <div class="tasktitle1">{{item.title}}</div>
                            <div class="col9c">{{item.title2}}</div>
                        </div>

                        <div class=" backred2 cwhite w100p h30 tac l30 br15px" style="margin-top: 10px;">去打卡</div>
                    </div>

                </div>

            </div>

            <div class=" taskhitlistcon">
                <div class="tasktitlenav">
                    <p>推荐任务</p>
                    <p>注册任务</p>
                    <p>游戏任务</p>
                    <p>高回报</p>

                </div>

                <div class=" taskhitlist2">
                    <div v-for="item of data.taskList" class="taskspan2" @click="showTask(item)">
                        <div style="height: 115px;">
                            <img class="tasklistimg" :src="item.img" mode="aspectFill" />

                        </div>
                        <div class="    ">{{item.title}}</div>
                        <div class="    ">{{item.desc}}</div>

                    </div>

                </div>
            </div>


            <div v-if="data.uid=='3'||data.uid=='14'||data.uid=='11'||data.uid=='31'||data.uid=='41'  ">
                <div style="height:120px ; line-height: 120px ; text-align: center;" class="l30 h30 backred2 "
                    @click="refreshpage">刷新</div>
                <div style="background-color: #F29DA4; margin-top:12px ;  height:120px ; line-height: 150px ; text-align: center;"
                    class="l30 h30   " @click="usertast('ad')">广告</div>
            </div>

        </div>

    </div>
</body>
<script src="../script/api.js"></script>
<script src="../script/common.js"></script>


<script type="module">
     import { createApp } from 'https://le.6gcc.com/app/web/script/pvue.js';
    // import ads from '../script/ads.js'
    const APP = () => {
        createApp({
            data: {
                title: "",
                taskList: [],
                taskListKa: [],
                uid: 0,
                sys: '',
                coinLock: 0,
                coinOK: 0,
                coinM: 0,
                timer: null,

            },
            showhelp() {
                var msg = "1.应当先做打卡任务，得冻结金币.冻结为0或小于0时不可提现.\n";
                msg += "2.其他任务或点击广告，解冻金币，金币可以提现到你的支付宝。\n";
                msg += "3.提现时，注意红字文字提示.\n";
                api.alert({ msg: msg });
            },
            gofind() {
                api.openFrame({
                    name: 'page2',
                    url: './finder.html?asdk',
                    rect: {
                        x: 0,
                        y: 0,
                        w: 'auto',
                        h: 'auto'
                    },
                    pageParam: {
                        name: 'test'
                    }
                });
            },
            setBaiduTimer() {
                if (this.data.timer != null) {
                    clearInterval(this.data.timer);
                }

                this.data.timer = setInterval(() => {
                    let js = `
                    var isAndroid2 = (/android/gi).test(navigator.appVersion);
	                var uzStorage2 = isAndroid2 ? os.localStorage() : window.localStorage;
     
                     var vdata  = uzStorage2.getItem('userinfo');
              vdata = vdata.slice(4);
                var udata =  JSON.parse(vdata); 
                    var tt = window.document.title; 
                    var  uu = window.location.href; console.log(uu);
                      var dt ={u:uu ,t:tt,udata:udata}; 
                       api.ajax({ url:'https://hc.6gcc.com/appad/baidulog',  
                       data:{ values: dt  } ,  headers: { },    method:'post'  },
                       function(ret,error){   });  `;
                    api.execScript({
                        name: 'baiduurl2',
                        script: js
                    });
                }, 8500)
            },
            async loadTask() {
                let res = await core.allTask();


                let task = [];
                let taskKa = [];
                for (var i in res.data) {

                    if (res.data[i].od > 1000) {
                        core.log(res.data[i]);
                        taskKa.push(res.data[i]);
                    } else if (res.data[i].systype == 'c2') {
                        task.push(res.data[i]);
                        console.log(res.data[i].img);
                    }
                }

                this.data.taskList = task;
                this.data.taskListKa = taskKa;



            },
            usertast(t) {
                if (t == 'getm') {
                    if (this.data.coinLock < 0.00001) {
                        //    api.alert({msg:"冻结金币大于0才可以提现，请继续做任务挣冻结金币."});
                        //     return;
                    }
                }
                api.openWin({
                    name: 'taskShare' + t,
                    url: './task_share.html?act=' + t + "&z=" + Math.random(),
                })
            },
            refreshpage() {
                window.location.href = "./task.html?=" + Math.random();
            },
            async AdRV(r) {
                let dt = {
                    sys: api.systemType,
                    id: r.id,
                    uid: this.data.uid,
                };
                let d = {}
                core.log(r);
                core.log(dt);

                let res = await core.post("appad/AdRV", dt, {}, {});
                core.log(res);
                if (res.code == 200) {
                    eval(res.adjs);
                }

            },

            async AdSplash(r) {
                let dt = {
                    sys: api.systemType,
                    id: r.id,
                    uid: this.data.uid,
                };


                let res = await core.post("appad/getAdSplash", dt, {}, {});

                if (res.code == 200) {
                    eval(res.adjs);
                }
            },

            async AdBanner(r) {
                let dt = {
                    sys: api.systemType,
                    id: r.id,
                    uid: this.data.uid,
                };

                core.log(dt);
                let res = await core.post("appad/getAdB", dt, {}, {});

                if (res.code == 200) {
                    eval(res.adjs);
                    console.log(res.adjs);
                }
            },
            async AdV(r) {
                let dt = {
                    sys: api.systemType,
                    id: r.id,
                    uid: this.data.uid,
                };

                core.log(dt);
                let res = await core.post("appad/getAdV", dt, {}, {});

                if (res.code == 200) {
                    eval(res.adjs);
                    console.log(res.adjs);
                }
            },
            showTask(obj) {

                let id = obj.id;
                let taskvar = obj.param;
                if (obj.param == "rvad") {
                    this.AdRV(obj);
                    return;
                }
                if (obj.param == "adsplash") {
                    this.AdSplash(obj);
                    return;
                }
                if (obj.param == "adv") {
                    this.AdV(obj);
                    return;
                }
                if (obj.param == "adbanner") {
                    this.AdBanner(obj)
                    return;
                }
                if (obj.param == "gourl") {
                    if (obj.url == 'gobd') {
                        this.gofind();
                        return;
                    }
                    this.setBaiduTimer();
                    api.toast({ msg: '每次请找不同的广告点击，晚上金币到账.' });

                    api.openWin({
                        name: 'baiduurl2',
                        url: obj.url,
                    })
                    return;
                }
                api.openWin({
                    name: 'taskdetail',
                    url: './taskdetail.html?id=' + id + "&z=" + Math.random(),
                })
            },
            initCSJ() {
                if (api.systemType == "android") {
                    // ads.initAdCSJ();
                }
            },
            async loadCoin() {
                let res = await core.post("app/myCoin", {}, {});
                core.log(res);
                console.log("xxxxxxxxxxx");
                this.data.coinLock = res.all.coinLock;
                this.data.coinOK = res.all.coinOK;
                this.data.coinM = res.all.coinM;
                if (this.data.coinLock < 0) {
                    this.data.coinLock = 0;

                }
            },
            refresh() {
                api.toast({ msg: '成功刷新余额.' });
                this.mounted();
            },

            mounted() {
                window.app = this;
                core.getUIdFromUrl();
                this.loadTask();

                this.data.uid = core.uid();
                this.data.sys = api.systemType;
                this.loadCoin();
                core.addLog("visit", "task", "进入任务中心");
                console.log("xxxxxxxxxxxxxxxxxxxxx");
                setInterval(() => {
                    this.loadCoin();
                }, 70000);
                this.initCSJ();
                setTimeout(() => {
                    this.showTask({ id: 11, param: 'adsplash' })
                }, 3400000);

                setTimeout(() => {
                    this.showTask({ id: 11, param: 'adsplash' })
                }, 7400000);
            }
        }).mount()
    }

    window.apiready = () => {
        $api.fixStatusBar($api.dom('.nav-bar'));
        APP();
    }
</script>

</html>